package com.yh.netty.c1.test;

import java.util.Scanner;

/**
 * @author MtRider
 * @version 1.0
 * @description 火柴
 * @GiteeAndGithub MtRider
 * @date 2022/3/16 10:18
 */
public class matches {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        n -= 4;
        int num = 0;
        for (int i = 0; i < 1000; i++) {
            //测试暴力可能超时
            for (int j = 0; j < 1000; j++) {
                int k = i + j;
                if (shu(i) + shu(j) + shu(k) == n) {
                    num++;
                }
            }
        }
        System.out.println(num);

    }

    public static int shu(int x) {
        int a[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
        int sum = 0;
        while (x > 9) {
            sum += a[x % 10];
            x /= 10;
        }
        //防止个位是0没办法循环
        sum += a[x];
        return sum;
    }
}
